package com.ysd.util;

import com.google.gson.Gson;

public class Result {
	public boolean success;
	public String code;
	public String msg;
	public Integer count;
	public Object data;
	public String remark;

	public static String toClient(String code, Object msg, Object data) {
		Result r = new Result();
		r.code = code;
		r.msg = msg.toString();
		r.data = data;
		Gson g = new Gson();
		return g.toJson(r);
	}
	
	public static String toClient(String code,String msg,Integer count, Object data) {
		Result r = new Result();
		r.code = code;
		r.msg = msg.toString();
		r.data = data;
		r.count = count;
		Gson g = new Gson();
		return g.toJson(r);
	}
	
	public static String toClient(boolean suc, Object msg, String remark) {
		Result r = new Result();
		r.success = suc;
		r.msg = msg.toString();
		r.remark = remark;
		Gson t = new Gson();
		return t.toJson(r);
	}
}